package cn.z2huo.knowledge.basic.internal.anonymous;

/**
 * <p>
 *
 * @author z2huo
 */
class Demo2 {

    public OneMethodInterface test1Method() {
        return () -> "hello world";
    }

    public OneMethodInterface test1Method2() {
        return new OneMethodInterface() {
            @Override
            public String readLabel() {
                return "hello world";
            }
        };
    }

    public MultiMethodInterface test2() {
        return new MultiMethodInterface() {
            @Override
            public String writeLabel() {
                return "hello world";
            }

            @Override
            public String readLabel() {
                return "hello world !";
            }
        };
    }

    public static void main(String[] args) {
        Demo2 demo2 = new Demo2();
        System.out.println(demo2.test1Method());
        System.out.println(demo2.test1Method2());

        System.out.println(demo2.test2().readLabel());
        System.out.println(demo2.test2().writeLabel());
    }

}
